package com.xy.core.util;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletContext;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class SpringBeanUtils
  implements ApplicationContextAware
{
  private static Log logger = LogFactory.getLog(SpringBeanUtils.class);
  private static ServletContext servletContext = null; 
  private static ApplicationContext appContext; 

  public void setApplicationContext(ApplicationContext paramApplicationContext)
    throws BeansException
  {
    appContext = paramApplicationContext;
  }
 

  public static Object getBean(String paramString)
  {
    return appContext.getBean(paramString);
  } 
  public static void init(ServletContext paramServletContext)
  {
    servletContext = paramServletContext;
  }
}

 